<?php
if(isset($_POST['Entry']))
{
	$con = Connect();
	mysql_query("DELETE FROM notes WHERE ID='".$_SESSION['ID']."' AND ENTRY='".$_POST['Entry']."'");
	Close($con);
}
$con = Connect();
$set = mysql_num_rows(mysql_query("SELECT * FROM notes WHERE ID LIKE'".$_SESSION['ID']."'"));
if($set != 0)
{
	echo '<form method="POST">
		<table class="NoteBlock">';
			$check = mysql_query("SELECT * FROM notes WHERE ID LIKE '".$_SESSION['ID']."' ORDER BY ENTRY");
			while($row = mysql_fetch_object($check))
			{
				echo '<tr><th ID="box"><a href="index.php?page=NoteEdit&Entry='.$row->Entry.'">'.$row->Title;
				echo '<span>'.$row->Text.'</span></a></th>';
				echo '<th><button class="buttonX" type="submit" name="Entry" value="'.$row->Entry.'">X</button></th></tr>';
			}
	echo'	</table>
	</form>';
}
Close($con);
?>
